package dowm1;

public class BankCardTest {
    public static void main(String[] args) {
        // 创建银行卡对象并测试
        BankCard bankCard = new BankCard(1000);
        bankCard.deposit(500);
        bankCard.withdraw(200);

        // 创建信用卡对象并测试
        CreditCard creditCard = new CreditCard(500);
        creditCard.deposit(300);
        creditCard.withdraw(800); // 超出余额，但未超出透支额度
        creditCard.withdraw(1000); // 超出透支额度，应该失败
    }

    }

